<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
	<div class="fui-header">
			<div class="fui-header-left" onclick="window.history.go(-1);">
				<a class="back"></a>
			</div>
			<div class="title">创建活动</div>
			<div class="fui-header-right"></div>
	</div>
	<div class="fui-content">
	<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">活动名称<span class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.post.title" value="{{pagedata.post.title}}" placeholder="请输入您的活动名称">
					</div>
				</div>
	</div>
	<div class="weui_cells_title">活动说明</div>
	<div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <textarea class="weui_textarea" ng-model="pagedata.post.description" value="{{pagedata.post.description}}" placeholder="请输入您的活动说明" rows="3"></textarea>
                    <div class="weui_textarea_counter">建议68个字以内！</div>
                </div>
            </div>
    </div>
		<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">活动地址<span class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.post.address" value="{{pagedata.post.address}}" placeholder="请输入您的活动地址">
					</div>
				</div>
	</div>
	<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">活动预计时长<span class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.duration" value="{{pagedata.post.duration}}" placeholder="请输入您的活动预计时长">
					</div>
				</div>
	</div>
	<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">活动开始时间<span class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="datetime-local" ng-model="pagedata.post.start" value="{{pagedata.post.start}}" placeholder="请输入活动开始时间">
					</div>
				</div>
	</div>
	<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">报名截止时间<span class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="datetime-local" ng-model="pagedata.post.end" value="{{pagedata.post.end}}" placeholder="请输入报名截止时间">
					</div>
				</div>
	</div>
	<div class="weui_cells weui_cells_form" >
			<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">活动封面图<span class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<ul class="weui_uploader_files" ng-if="pagedata.post.image">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.post.image)}})"></li>
						</ul>
						<div class="weui_uploader_input_wrp">
							 <input class="weui_uploader_input" ng-click="up_file(pagedata.post,'image','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
						</div>
					</div>
		</div>
		</div>
			<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">活动报名费用</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.money" value="{{pagedata.post.money}}" placeholder="请输入您的活动报名费用">
					</div>
				</div>
			</div>
			<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">最大报名人数</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.mannum" value="{{pagedata.post.mannum}}" placeholder="请输入您的活动允许最大报名人数">
					</div>
				</div>
			</div>
			<div class="weui_cells weui_cells_form">
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">活动发起方</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.organize" value="{{pagedata.post.organize}}" placeholder="请输入您的活动发起方">
					</div>
				</div>
			</div>
			<div class="weui_cells_title">活动幻灯片</div>
			<div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <div class="weui_uploader">
                        <div class="weui_uploader_bd">
                            <ul class="weui_uploader_files">
                                <li ng-repeat="p in pagedata.post.images" class="weui_uploader_file" style="background-image:url('{{tomedia(p)}}')">
									<div class="upbtn" >
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.post.images.splice($index-1,0,p);pagedata.post.images.splice($index+1,1)">上移</a>
										<a style="color:#f60" href="javascript:;" ng-click="pagedata.post.images.splice($index,1)">删除</a>
									</div>
								</li>
                            </ul>
                            <div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(pagedata.post,'images')"></div>
                        </div>
                    </div>
                </div>
            </div>
			</div>
	<div ng-repeat="item in pagedata.post.fileds">
			<div class="weui_cells weui_cells_form" ng-if="item.type == 1">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">{{item.title}}<span ng-if="item.is_must" class="must"></span></label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
                </div>
            </div>
			</div>
			<div class="weui_cells weui_cells_form" ng-if="item.type == 2">
			 <div class="weui_cell" ng-if="item.type == 2">
                <div class="weui_cell_hd"><label class="weui_label">{{item.title}}<span ng-if="item.is_must" class="must"></span></label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
                </div>
            </div>
			</div>
			<div class="weui_cells weui_cells_form" ng-if="item.type == 3">
			<div class="weui_cell" ng-if="item.type == 3">
					<div class="weui_cell_hd"><label class="weui_label">{{item.title}}<span ng-if="item.is_must" class="must"></span></label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<ul class="weui_uploader_files" ng-if="item.data">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(item.data)}})"></li>
						</ul>
						<div class="weui_uploader_input_wrp">
							 <input class="weui_uploader_input" ng-click="up_file(item,'data','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
						</div>
					</div>
			</div>
			</div>
				<div ng-if="item.type == 4" class="weui_cells_title">{{item.title}}<span ng-if="item.is_must" class="must"></span></div>
				<div ng-if="item.type == 4" class="weui_cells weui_cells_radio2">
						<label class="weui_cell weui_check_label dashed" ng-repeat="(key,value) in item.value">

							<div class="weui_cell_bd weui_cell_primary">
								<span style="float:left;width:100%">{{value}}</span>
							</div>
							<div class="weui_cell_ft" href="javascript:;"  ng-click="item.data=value;">
								<input type="radio" class="weui_check" name="radio1">
								<span class="weui_icon_checked"></span>
							</div>
						</label>
				</div>	
				<div ng-if="item.type == 5" class="weui_cells_title">{{item.title}}<span ng-if="item.is_must" class="must"></span></div>
				<div ng-if="item.type == 5" class="weui_cells weui_cells_checkbox" style="padding:0.5rem">
						<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem" ng-repeat="(key,value) in item.value">
							<input type="checkbox" ng-click="duoxuans(value,item,'data')" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" value="{{key}}" id="s11"> {{value}}
						</div>
				</div>
				<div ng-if="item.type == 6" class="weui_cells_title">{{item.title}}<span ng-if="item.is_must" class="must"></span></div>
				<div ng-if="item.type == 6" class="weui_cells weui_cells_form">
				<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<textarea class="weui_textarea" ng-model="item.data" placeholder="请输入{{item.title}}" rows="2"></textarea>
							<div class="weui_textarea_counter"><span>0</span>/118</div>
						</div>
					</div>
				</div>
				<div ng-if="item.type == 7" class="weui_cells_title">{{item.title}}<span ng-if="item.is_must" class="must"></span></div>
				<div ng-if="item.type == 7" class="weui_cells weui_cells_form" ng-init="pagedata.getlocation($index)">
					<div class="weui_cell">
						<div class="fui-cell-label" style="width:33%">
							<select ng-model="item.data.province" class="form-control tpl-province">
							<option value="" selected="selected">省份</option>
							<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="item.data.province==value">{{value}}</option>
							</select>
						</div>
						<div class="fui-cell-label" style="width:33%">
							<select ng-model="item.data.city" class="form-control tpl-city">
							<option value="" selected="selected">城市</option>
							<option ng-repeat="(value,data) in pagedata.province[item.data.province]" value="{{value}}" ng-selected="item.data.city==value">{{value}}</option>
							</select>
						</div>
						<div class="fui-cell-label" style="width:33%">
							<select ng-model="item.data.district" class="form-control tpl-district">
							<option value="" selected="selected">区县</option>
							<option ng-repeat="(value,data) in pagedata.province[item.data.province][item.data.city]" value="{{value}}" ng-selected="item.data.district==value">{{value}}</option>
							</select>
						</div>
						<div class="fui-cell-label" style="width:28%">
							<select ng-model="item.data.street" class="form-control tpl-district">
							<option value="" selected="selected">街道</option>
							<option ng-repeat="value in pagedata.province[item.data.province][item.data.city][item.data.district]" value="{{value}}" ng-selected="item.data.street==value">{{value}}</option>
							</select>
						</div>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="item.data.xiangxi" placeholder="输入详细地址">
                </div>
				</div>
        </div>
	<div class="weui_btn_area">
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.submit()">提交</a>
	</div>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.submit=function(){
	var dt=new Date(scope.pagedata.post.start);
	var sc=parseInt(dt.getTime()/1000);
	var t=scope.date(sc);
	//alert(t);return;
	//scope.pagedata.post.start=sc;
	scope.post(scope.pagedata.post,'main');
}
</script>